package org.zfes.snowier.cloud.zbss.pmp.router.service.dev;


import java.util.Optional;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.ResponseBody;

import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.auth.shiro.util.SecurityUtil;
import org.zfes.snowier.cloud.zbss.pmp.dto.PmpTasksSubmitDto;
import org.zfes.snowier.cloud.zbss.pmp.model.PmpTasks;
import org.zfes.snowier.cloud.zbss.pmp.service.IPmpTasksService;
@Controller("org.zfes.snowier.cloud.zbss.pmp.router.service.dev.pmpTasksController")
@RequestMapping("/pmp/service/dev/pmpTasks")
public class PmpTasksController extends BaseController {

	
	@Autowired
	private IPmpTasksService pmpTasksService;

	
    @RequestMapping(value="/loadPmpTasks", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadPmpTasks(Long id){
		Optional<PmpTasks> ops = pmpTasksService.loadPmpTasksById(id);
		return ajaxQuery("pmpTasks",ops);
    }
 
 //任务提交   
    @RequestMapping(value="/submitTasks", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object submitTasks(PmpTasksSubmitDto pmpTasksSubmitDto){
    	pmpTasksService.submitTasks(SecurityUtil.getUserId().get(),pmpTasksSubmitDto);
    	return ajaxDoneSuccess("数据操作成功 ");
    }

    
}